package com.ydgg.ltar.util;

import java.util.Locale;

import com.google.i18n.phonenumbers.NumberParseException;
import com.google.i18n.phonenumbers.PhoneNumberUtil;
import com.google.i18n.phonenumbers.Phonenumber.PhoneNumber;
import com.google.i18n.phonenumbers.geocoding.PhoneNumberOfflineGeocoder;

public class MobileUtils {

	public static String address(String telphone){
		
		PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
		PhoneNumberOfflineGeocoder phoneNumberOfflineGeocoder = PhoneNumberOfflineGeocoder.getInstance();

		String language ="CN";
		PhoneNumber referencePhonenumber = null;

		try {
			referencePhonenumber = phoneUtil.parse(telphone, language);
		} catch (NumberParseException e) {
			e.printStackTrace();
		}
		//手机号码归属城市 city
		String city= phoneNumberOfflineGeocoder.getDescriptionForNumber(referencePhonenumber,Locale.CHINA);
		return city;
	}
}
